import { apiGetHotSearch } from '@/api/index'

export default {
  namespaced: true,
  state: {
    data: [],
    curArticleLink: ''
  },
  mutations: {
    // 设置列表数据
    SET_LIST(state, data) {
      state.data = data
    },
  },
  actions: {
    // 获取列表数据
    async getList({ commit }) {
      const { data } = await apiGetHotSearch({
        type: 'baidu'
      })
      commit('SET_LIST', data)
    }
  }
}
